package com.zbkj.crmeb.store.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.common.CommonPage;
import com.common.PageRequest;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zbkj.crmeb.store.dao.SupplierProductLogDao;
import com.zbkj.crmeb.store.model.SupplierProductLog;
import com.zbkj.crmeb.store.service.SupplierProductLogService;

@Service
public class SupplierProductLogServiceImpl extends ServiceImpl<SupplierProductLogDao, SupplierProductLog> implements SupplierProductLogService {
    @Resource
    private SupplierProductLogDao supplierProductLogDao;

	@Override
	public PageInfo<SupplierProductLog> pageEntity(PageRequest request) {
        Page<Object> page = PageHelper.startPage(request.getPageNow(), request.getPageSize());
        List<SupplierProductLog> supplierProductLogs = this.list(Wrappers.<SupplierProductLog>lambdaQuery()
        		.orderByDesc(SupplierProductLog :: getCreateTime)
        		);
        
        return CommonPage.copyPageInfo(page, supplierProductLogs);
    }

}
